package zhoug.demo.chart2;

import android.os.Bundle;
import android.widget.Toast;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;


/**
 * @Author: zhoug
 * @Date: 2023/1/6
 * @Description:
 */
public abstract class BaseActivity extends AppCompatActivity {
    protected static final String TAG = ">>>BaseActivity";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutResId());
        findViews();
        init();
    }

    //#################抽象方法定义#######################
    protected abstract @LayoutRes
    int getLayoutResId();

    protected abstract void findViews();

    protected abstract void init();




    //#################公用方法定义#######################

    protected void toast(Object obj) {
        Toast.makeText(this, obj != null ? obj.toString() : "", Toast.LENGTH_LONG).show();
    }

    protected BaseActivity getActivity() {
        return this;
    }

}
